using System;
using System.Collections.Generic;
using System.Text;

namespace TXLooker.Common.UI
{
    public class TreeNodeTag<T>
    {
        static TreeNodeTag()
        {
            Type type = typeof(T);

            if( !type.IsEnum )
                throw new ArgumentException( string.Format( "Type '{0}' must be Enum", type.ToString() ) );
        }
        public TreeNodeTag()
        { }
        public TreeNodeTag( T nodeType, object tagNode ) : this()
        {
            this.NodeType = nodeType;
            this.Tag = tagNode;
        }

        public T NodeType
        {
            get { return this.m_nodeType;  }
            set { this.m_nodeType = value; }
        }
        private T m_nodeType = default( T );

        public object Tag
        {
            get { return this.m_tag;  }
            set { this.m_tag = value; }
        }
        private object m_tag = null;
    }
}
